feat(remote-config): add getAll() method#977
Conversation
getAll() method
There was a problem hiding this comment.
Pull request overview
This PR adds a getAll() API to the Remote Config plugin so consumers can retrieve all configured key/value pairs across Web, Android, and iOS.
Changes:
- Adds
getAll()to TypeScript plugin definitions and Web implementation. - Implements native
getAll()bridge methods for Android and iOS. - Updates README API docs and adds a changeset for the minor release.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/remote-config/src/web.ts |
Adds Web getAll() using Firebase JS SDK values. |
packages/remote-config/src/definitions.ts |
Adds public API and result types for getAll(). |
packages/remote-config/README.md |
Documents the new method and result interfaces. |
packages/remote-config/ios/Plugin/FirebaseRemoteConfigPlugin.swift |
Registers and resolves the iOS bridge method. |
packages/remote-config/ios/Plugin/FirebaseRemoteConfig.swift |
Collects iOS remote/default keys and values. |
packages/remote-config/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/remoteconfig/FirebaseRemoteConfigPlugin.java |
Adds Android bridge serialization for all values. |
packages/remote-config/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/remoteconfig/FirebaseRemoteConfig.java |
Exposes Android Firebase Remote Config getAll(). |
.changeset/remote-config-get-all.md |
Adds a minor release changeset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
|
@robingenz Looks great, thanks! Should the web implementation include source? public async getAll(): Promise<GetAllResult> {
const remoteConfig = getRemoteConfig();
const all = getAll(remoteConfig);
const values: Record<string, GetAllResultValue> = {};
for (const key of Object.keys(all)) {
values[key] = { value: all[key].asString(), source: all[key].getSource() };
}
return { values };
} |
|
Good catch — I considered this in the original plan but kept it out to match the existing |
|
Thank you! |
Summary
getAll()to the@capacitor-firebase/remote-configplugin, returning every Remote Config key/value pair as strings, withsource(Static/Default/Remote) on Android and iOS.getAll(); Android usesFirebaseRemoteConfig.getAll(); iOS unions keys from.defaultand.remotesources and reads each viaconfigValue(forKey:).Test plan
FirebaseRemoteConfig.getAll()afterfetchAndActivate()and confirm every fetched key is present.FirebaseRemoteConfig.getAll()afterfetchAndActivate()and confirm values +sourceare correct.FirebaseRemoteConfig.getAll()afterfetchAndActivate()and confirm values +sourceare correct, including default keys.Closes #976